import { defineStore } from 'pinia'
export const useCenterInfoStore = defineStore('centerInfo', {
  state: () => {
    return {
      centerInfo: null
    }
  },
  actions: {
    /**
    * 请求个人中心信息（店铺审核状态）
    */
    getCenterInfo () {
      return new Promise((resolve) => {
        http.get('/p/user/centerInfo', {
        })
          .then(({ data }) => {
            this.setCenterInfo(data)
            resolve(data)
          })
      })
    },
    // 更新配置
    setCenterInfo (data) {
      this.centerInfo = data
    }
  }
})
